package com.example.demo.model;

import jakarta.validation.constraints.*;
import java.math.BigDecimal;
import java.time.LocalDate;


//http://localhost:8080/api/worker/create
@lombok.Data
public class Worker {

    @NotNull(message = "Name cannot be null")
    private String name;

    @Min(value = 18, message = "Age must be greater than or equal to 18")
    private int age;

    @Size(min = 4, max = 4, message = "Badge number must be 10 digits")
    private String badgeNumber;


    @Past(message = "Birth date cannot be in the future")
    private LocalDate birthDate;

    @Future(message = "Hire date cannot be in the past")
    private LocalDate hireDate;


    @Pattern(regexp = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", message = "Invalid email format")
    private String email;


    @Email(message = "Invalid email format")
    private String email2;


//    @Positive(message = "Salary must be positive")
    @PositiveOrZero(message = "Salary must be zero or positive")
    private BigDecimal salary;

}
